import React from 'react';
import { AppRegistry } from 'react-native';
import { setJSExceptionHandler } from 'react-native-exception-handler';
import { App } from './rn/entry/wallet';

setJSExceptionHandler((e, isFatal) => {
    if (isFatal) {
        alert(
            'Unexpected error occurred',
            `
            Error: ${isFatal ? 'Fatal:' : ''} ${e.name} ${e.message}
            We will need to restart the app.
            `
        );
    } else {
        console.log(e); // So that we can see it in the ADB logs in case of Android if needed
    }
}, true);

AppRegistry.registerComponent('RNWallet', () => App);
